<?php
/**
 * XCL Code Generator ver 0.01
 * @package scuttle
 * @file /forms/WatchedFilterForm.class.php 2009-5-31 21:27
 **/

if (!defined('XOOPS_ROOT_PATH')) exit();

require_once XOOPS_MODULE_PATH . '/scuttle/class/AbstractFilterForm.class.php';

define('SC_SORT_KEY_WID', 1);
define('SC_SORT_KEY_UID', 2);
define('SC_SORT_KEY_WATCHED', 3);


define('SC_SORT_KEY_DEFAULT', SC_SORT_KEY_WID);

class Scuttle_WatchedFilterForm extends Scuttle_AbstractFilterForm
{
	var $mSortKeys = array(
		SC_SORT_KEY_WID => 'wId',
		SC_SORT_KEY_UID => 'uId',
		SC_SORT_KEY_WATCHED => 'watched',
	);
	function getDefaultSortKey()
	{
		return SC_SORT_KEY_DEFAULT;
	}

	function fetch()
	{
		parent::fetch();

		if (isset($_REQUEST['wId'])) {
			$this->mNavi->addExtra('wId', xoops_getrequest('wId'));
			$this->_mCriteria->add(new Criteria('wId', xoops_getrequest('wId')));
		}

		if (isset($_REQUEST['uId'])) {
			$this->mNavi->addExtra('uId', xoops_getrequest('uId'));
			$this->_mCriteria->add(new Criteria('uId', xoops_getrequest('uId')));
		}

		if (isset($_REQUEST['watched'])) {
			$this->mNavi->addExtra('watched', xoops_getrequest('watched'));
			$this->_mCriteria->add(new Criteria('watched', xoops_getrequest('watched')));
		}

		$this->_mCriteria->addSort($this->getSort(), $this->getOrder());

	}
}

?>